use colored::*;

/// 命令行-消息类型
pub enum Type {
    _Warning,
    _Skipped,
    Error,
    Info,
    Success,
}

/// 命令行-输出消息
// 注意：这不是日志记录，只是命令行的消息
pub fn push_message(log_type: Type, message: &str) {
    let prefix = match log_type {
        Type::_Warning => format!("{}{}{}", "[".bold(), "警告".bold().yellow(), "]".bold()),
        Type::_Skipped => format!("{}{}{}", "[".bold(), "跳过".bold().yellow(), "]".bold()),
        Type::Error => format!("{}{}{}", "[".bold(), "错误".bold().red(), "]".bold()),
        Type::Info => format!("{}{}{}", "[".bold(), "信息".bold().cyan(), "]".bold()),
        Type::Success => format!("{}{}{}", "[".bold(), "成功".bold().green(), "]".bold()),
    };
    eprintln!("{} {}", prefix, message)
}
